package cfgs.gestudent.finestra.main;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import cfgs.gestudent.preferencies.ConfiguracionsIdiomes;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ResourceBundle;
import javax.swing.JLabel;

public class FinestraLog extends JDialog {

	private static final long serialVersionUID = 4414954027286805226L;
	private final JPanel contentPanel = new JPanel();
	
	private ResourceBundle rb = null;
	private ConfiguracionsIdiomes configs = new ConfiguracionsIdiomes();
	
	private JLabel lblUsuari = null;

	/**
	 * Create the dialog.
	 */
	public FinestraLog() {
		//TODO LOGIN configurar pantalla FINESTRA LOGGIN
		//esta ventana si se cierra se cierra la aplicacion
		//no se puede redimenzionar
		setBounds(100, 100, 450, 200);
		rb = configs.getIdioma();
		setTitle(rb.getString("titolFinestraLog"));
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setLayout(new FlowLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		{
			lblUsuari = new JLabel(rb.getString("lblUsuari")+" :");
			contentPanel.add(lblUsuari);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton("Aceptar");
				okButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						FinestraPrincipal frame = new FinestraPrincipal();
						frame.setVisible(true);
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Cancelar");
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
	}

}
